package com.yaorange.guild.association.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yaorange.guild.association.entity.BsAssociationCouncil;
import com.yaorange.guild.association.mapper.BsAssociationCouncilMapper;
import com.yaorange.guild.association.service.BsAssociationCouncilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 协会理事会成员信息Service实现类
 */
@Service
public class BsAssociationCouncilServiceImpl implements BsAssociationCouncilService {

    @Autowired
    private BsAssociationCouncilMapper bsAssociationCouncilMapper;

    /**
     * 插入协会理事会成员信息
     */
    @Override
    public int insert(BsAssociationCouncil council) {
        return bsAssociationCouncilMapper.insert(council);
    }

    /**
     * 根据主键更新协会理事会成员信息
     */
    @Override
    public int updateById(BsAssociationCouncil council) {
        return bsAssociationCouncilMapper.updateById(council);
    }

    /**
     * 根据主键删除协会理事会成员信息
     */
    @Override
    public int deleteById(Long id) {
        return bsAssociationCouncilMapper.deleteById(id);
    }

    /**
     * 根据主键查询协会理事会成员信息
     */
    @Override
    public BsAssociationCouncil selectById(Long id) {
        return bsAssociationCouncilMapper.selectById(id);
    }

    /**
     * 查询所有协会理事会成员信息
     */
    @Override
    public List<BsAssociationCouncil> selectAll(BsAssociationCouncil query) {
        return bsAssociationCouncilMapper.selectAll(query);
    }

    /**
     * 分页查询协会理事会成员信息
     */
    @Override
    public PageInfo<BsAssociationCouncil> selectPage(BsAssociationCouncil query, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<BsAssociationCouncil> list = bsAssociationCouncilMapper.selectAll(query);
        return new PageInfo<>(list);
    }
}
